Skip to content

Fix "null" string literal in steps that no exception text#1170

Merged
timja merged 3 commits intojenkinsci:mainfrom
stuartrowe:issue-1169-null-exception-text
Mar 4, 2026
Merged

Fix "null" string literal in steps that no exception text#1170
timja merged 3 commits intojenkinsci:mainfrom
stuartrowe:issue-1169-null-exception-text

Conversation

@stuartrowe
Copy link
Contributor

@stuartrowe stuartrowe commented Mar 3, 2026

Fixes #1169

Calling HttpResponses.text(null) will create a response with text containing the string literal "null".

Instead, pass the empty string "" as the response text when the exception text is null.

On the client side, check if the response text is valid (not null and not empty) before using it. Otherwise, return an empty array for the exception text.

Testing done

Local testing along with the added unit tests.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

Rowe, Stuart added 3 commits March 3, 2026 14:47
- return an empty string when the step's exception text is null
- return an empty array from RestClient getExceptionText if the response text is empty
@stuartrowe stuartrowe requested a review from a team as a code owner March 3, 2026 23:05
@timja timja added the bug Something isn't working label Mar 4, 2026
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@timja timja merged commit b88f7aa into jenkinsci:main Mar 4, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetchExceptionText retrieves "null" string literal for steps that have no exception text

2 participants